package com.yuanqi.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanqi.dto.PurchaseReturnOrderDTO;
import com.yuanqi.pojo.PurchaseReturnOrder;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 退货订单服务接口
 */
public interface PurchaseReturnOrderService extends IService<PurchaseReturnOrder> {

    /**
     * 创建退货订单
     */
    PurchaseReturnOrderDTO createReturnOrder(PurchaseReturnOrderDTO returnOrderDTO);

    /**
     * 更新退货订单
     */
    boolean updateReturnOrder(PurchaseReturnOrderDTO returnOrderDTO);

    /**
     * 获取退货订单详情
     */
    PurchaseReturnOrderDTO getReturnOrderDetail(Long returnOrderId);

    /**
     * 分页查询退货订单
     */
    IPage<PurchaseReturnOrderDTO> pageReturnOrders(Page<PurchaseReturnOrder> page, String returnOrderCode, Long customerId, Integer status);

    /**
     * 审核退货订单
     */
    boolean approveReturnOrder(Long returnOrderId, String approvalRemark);

    /**
     * 拒绝退货订单
     */
    boolean rejectReturnOrder(Long returnOrderId, String rejectReason);

    /**
     * 处理退货订单
     */
    boolean processReturnOrder(Long returnOrderId, String processRemark);

    /**
     * 根据销售订单ID查询退货订单
     */
    List<PurchaseReturnOrder> getReturnOrdersBySalesOrderId(Long salesOrderId);

    /**
     * 生成退货订单号
     */
    String generateReturnOrderCode();
}








